﻿// Copyright (c)  YISH. All rights reserved.
// Licensed under the MIT License, See License.txt in the project root for license information.

using NSQL.Sharpen;

namespace NSQL.Expressions.Functions
{
    public class UpperFunction : BaseExpression, IUpperFunction
    {
        public IStringExpression Text { get; set; }

        public UpperFunction(IExpression text)
        {
            Text = (IStringExpression) text;
        }

        public override T Accept<T>(IExpressionVisitor<T> visitor) => visitor.Visit(this);
        public override void Accept(IExpressionVisitor visitor) => visitor.Visit(this);
        public override bool IsValid => Text.IsValid;
        protected override IExpression DeepCopy()
        {
            return new UpperFunction(Text.DeepClone())
            {
                Tag = Tag
            };
        }
    }
}